class MiniGorm {
	def db = []
	def methodMissing(String name, Object args) {
		db.find {
			it[name.toLowerCase() - 'findby'] == args[0]
		}
	}
}

def people = new MiniGorm()
def zhaobo = [first:'zhao', last:'bo']
def djh = [first:'d', last:'jh']
people.db << zhaobo << djh

assert people.findByFirst('zhao') == zhaobo
assert people.findByLast('jh') == djh

